<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	
		
		<script type="text/javascript">
			//常量
			console.log(Math.PI);
			
			//函数
			console.log(Math.abs(-10));
			
			var n=4-5;
			console.log(Math.ceil(n));//5
			console.log(Math.floor(n));//4
			console.log(Math.round(n));//5
			
			console.log(Math.pow(2,3));
			console.log(Math.sqrt(4));
			
			console.log(Math.random());//0-1
			
			console.log(Math.floor(Math.random()*10));//0-9

		function play()
		{
			//得到玩家输入
			var playerHand =document.getElementById("input1").value;
			//电脑随机一个0-2的数
			var computerHand=Math.floor(Math.random()*3);
			console.log("电脑随机数："+computerHand);
			//比较输赢
			if (playerHand==0computerHand) {
				
			} else{
				
			}
		}


				
			
		</script>
	<h1>猜拳游戏</h1>
		请输入0 石头 1 剪刀 2 布
		<input type="text"  id="input1" />
		<button onclick="play()">猜拳</button>
	</body>
</html>
